package com.cw.windows.action;

import java.awt.event.ActionEvent;
import java.util.Vector;

import javax.swing.JInternalFrame;

import com.cw.action.LotteryAction;
import com.cw.gui.MainPanel;

public class CloseAllAction extends LotteryAction {

	public CloseAllAction(String name, String icon, MainPanel t) {
		super(t, name, icon);
	}

	/**
	 * Invoked when an action occurs.
	 * 
	 * @param e
	 *            ActionEvent
	 * @todo Implement this java.awt.event.ActionListener method
	 */
	public void actionPerformed(ActionEvent e) {
		Vector allw = mPanel.getFrame().getMenu().getSV();

		for (int i = 0; i < allw.size(); i++) {
			Object tmpObj = allw.get(i);
			((JInternalFrame) tmpObj).doDefaultCloseAction();
			i--;
		}
	}

}
